<%@ Page Language="VB" Debug="true"%> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Data" %> <% Dim conDept As New SqlConnection("Server=ameliorate.ads.wsc.ma.edu;Initial Catalog=wsc; User ID=events; Password=events@wsc") Dim cmdDept As New SqlCommand("prc_DeptInfo", conDept) cmdDept.Parameters.Add("@deptID", SqlDbType.Int, 4).Value = Convert.ToInt32(Request.QueryString("deptid")) Dim dtrDept As SqlDataReader cmdDept.CommandType = CommandType.StoredProcedure conDept.Open() dtrDept = cmdDept.ExecuteReader() While dtrDept.Read() %>
<%=dtrDept("deptName")%>

Chair: <%=dtrDept("chairFirst") %> <%=dtrDept("chairLast") %>
<% If IsDBNull(dtrDept("deptPhone")) Or Convert.ToString(dtrDept("deptPhone")) = "" Then Else %> Main Phone Number: 413-572-<%=dtrDept("deptPhone")%>
<% End If 'Phone is Null If IsDBNull(dtrDept("deptFax")) Or Convert.ToString(dtrDept("deptFax")) = "" Then Else If ((dtrDept("deptFax") >= "3000") AND (dtrDept("deptFax") <= "3999")) Then 'They are using the new exchange %> Fax: 413-579-<%=dtrDept("deptFax") %>
<% Else 'They are using the old exchange %> Fax: 413-572-<%=dtrDept("deptFax") %>
<% End If End If 'Fax is Null If IsDBNull(dtrDept("deptWeb")) Or Convert.ToString(dtrDept("deptWeb")) = "" Then %>

<% Else %> Webpage: "><%=dtrDept("deptWeb")%>

<% End If 'Web is null End While dtrDept.Close() conDept.Close() %> <% Dim con As New SqlConnection("Server=ameliorate.ads.wsc.ma.edu;Initial Catalog=wsc; User ID=events; Password=events@wsc") Dim cmd As New SqlCommand("prc_SearchStaffbyDeptID", con) cmd.Parameters.Add("@deptID", SqlDbType.Int, 4).Value = Convert.ToInt32(Request.QueryString("deptid")) Dim dtr As SqlDataReader cmd.CommandType = CommandType.StoredProcedure con.Open() dtr = cmd.ExecuteReader() While dtr.Read() %> <% End While dtr.Close() con.Close() %>

Name

Phone

Title

Location

<% If IsDBNull(dtr("email")) Or Convert.ToString(dtr("email")) = "" Then %>

<%=dtr("lastName")%>, <%=dtr("firstName")%>

<% Else %>

"><%=dtr("lastName")%>, <%=dtr("firstName")%>

<% End If %>
<% If IsDBNull(dtr("telephone")) Or Convert.ToString(dtr("telephone")) = "" Then Else %>

413-572-<%=dtr("telephone")%>

<% End If %>

<%=dtr("rankName")%>

<%=dtr("title")%>

<%=dtr("buildingName") & " " & dtr("room_no")%>